import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) throws IOException {
        File f = new File("d:/tttttt.txt");
        f.createNewFile();
        f.deleteOnExit();//等进程结束后再删除文件
        System.out.println("进程结束前"+f.exists());
        Scanner in = new Scanner(System.in);
        in.next();//阻塞进程结束
        System.out.println("进程结束后："+f.exists());
    }
    public static void main1(String[] args) throws IOException {
        File f = new File("./test222.txt");
        f.createNewFile();//需要抛出异常
    }
}
